package com.ft.oa.domain.project;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ft.oa.domain.Attachment;
import com.ft.oa.domain.dto.knowledgeBase.AttachmentDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 项目阶段表实体
 * @author hefeng
 * @ClassName ExecProjectStage
 * @date 2021/12/30 10:47
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "exec_project_stage",autoResultMap = true)
public class ExecProjectStage {

    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 关联表主键
     */
    private Long relationId;

    /**
     * 项目阶段状态:0需求调研,1方案设计,2设备采购,3系统安装,4物流发货,5现场调试,6现场培训,7项目验收
     */
    private Integer stageStatus;

    /**
     * 阶段名称
     */
    @TableField(exist = false)
    private String stageName;

    /**
     * 关联项目编码
     */
    private String projectNumber;

    /**
     * 顺序
     */
    //private Integer seq;

    /**
     * 项目阶段成果文档aid
     */
    private String fileIds;

    /**
     * 阶段计划完成日期(截止日期)
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
    private LocalDate endDate;

    /**
     * 权重
     */
    private BigDecimal weight;

    /**
     *创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime = LocalDateTime.now();

    /**
     *修改时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime = LocalDateTime.now();

    /**
     * 是否删除:0否,1是
     */
    private Integer del;

    /**
     * 验收: 0-未验收  1-已验收
     */
    private Integer acceptStatus;

    //以下为附件上传用到
    /**
     * 接收前端传递数据
     */
    @TableField(exist = false)
    private List<AttachmentDto> attachments;

    //attachments附件上传json存储字段
    private String achment;

    @TableField(exist = false)
    private List<Attachment> attachment;

}
